package com.hhkj.api.wechat.controller;

import com.hhkj.admin.bank.controller.BankController;
import com.hhkj.api.sale.common.session.model.LoginSale;
import com.hhkj.api.wechat.model.req.OpenIdGetReq;
import com.hhkj.api.wechat.service.biz.ApiSaleWechatAppBizService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.framework.login.api.ApiLogin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ApiWechatAppController
 *
 * @author HHKJ-SERVER-ZJ
 * @since 2023/11/17 20:46
 */
@RestController
@RequestMapping("/api/sale/wechat/app")
public class ApiSaleWechatAppController extends BankController {

    @Autowired
    private ApiSaleWechatAppBizService apiWechatAppBizService;

    /** 获取微信小程序openId */
    @ApiLogin(LoginSale.class)
    @PostMapping("/open/id")
    public AjaxResult getOpenId(@Validated @RequestBody OpenIdGetReq req) {
        return AjaxResult.success(apiWechatAppBizService.getOpenId(req));
    }

}
